<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 商家入驻申请表
 */
class Enter extends Model
{
    protected $table = 'enters';

    protected $fillable = [
        'id',
        'uid', //user id
        'phone', //手机
        'qq',  //qq
        'email', //email
        'status', //状态 0 入驻中 1 审核通过 2审核失败 3 待审核
        'note', //审核不通过原因
    ];

    const S_ONE = 0;
    const S_TWO = 1;
    const S_THREE = 2;
    const S_FOUR = 3;

    public static $STATUS = [
        self::S_ONE => '入驻中',
        self::S_TWO => '审核通过',
        self::S_THREE => '审核失败',
        self::S_FOUR => '待审核',
    ];

    public function user()
    {
        return $this->hasOne('App\\Models\\User', 'id', 'uid');
    }
}
